/**
 * 单个的省份信息
 */
export interface ProvinceItem {
  id: number;
  createTime: string;
  updateTime: string;
  isDeleted: number;
  param: {};
  parentId: number;
  name: string;
  value: string;
  dictCode?: any;
  hasChildren: boolean;
}

//定义一个类型别名
export type ProvinceItems = ProvinceItem[];

//1. 准备单条数据的结构
export interface HospitalListItem {
  /**
   * ID
   */
  id: string;
  /**
   * 创建时间
   */
  createTime: string;
  /**
   * 更新时间
   */
  updateTime: string;
  /**
   * 是否删除
   */
  isDeleted: number;
  /**
   * 医院详情
   */
  param: Param;
  /**
   * 医院编号
   */
  hoscode: string;
  /**
   * 医院名称
   */
  hosname: string;
  /**
   * 医院类型
   */
  hostype: string;
  /**
   * 省份编号
   */
  provinceCode: string;
  /**
   * 城市编号
   */
  cityCode: string;
  /**
   * 区域编号
   */
  districtCode: string;
  /**
   * 地址
   */
  address: string;
  /**
   * logo 图片
   */
  logoData: string;
  /**
   * 介绍
   */
  intro?: any;
  /**
   * 乘车路线
   */
  route: string;
  /**
   * 状态
   */
  status: number;
  /**
   * 预约规则
   */
  bookingRule: BookingRule;
}

interface BookingRule {
  /**
   * 预约周期
   */
  cycle: number;
  /**
   * 放号时间
   */
  releaseTime: string;
  /**
   * 停挂事件
   */
  stopTime: string;
  /**
   * 退号日期
   */
  quitDay: number;
  /**
   * 退号时间
   */
  quitTime: string;
  /**
   * 详细规则
   */
  rule: string[];
}

interface Param {
  /**
   * 医院类型字符串
   */
  hostypeString: string;
  /**
   * 医院详细地址
   */
  fullAddress: string;
}

/**
 * 针对搜索表单的元素值进行约束
 */
export interface ReqGetHospitalSelParams {
  hoscode?: string;
  hosname?: string;
  hostype?: string;
  provinceCode?: string;
  cityCode?: string;
  districtCode?: string;
  status?: number;
}

//定义获取医院列表的参数接口
export interface ReqGetHospitalListParams extends ReqGetHospitalSelParams {
  page: number;
  limit: number;
}

/**
 * 请求医院列表响应的结果结构
 */
export interface ReqGetHospitalListResponse {
  /**
   * 医院数据
   */
  content: HospitalListItem[];
  /**
   * 分页相关
   */
  pageable: Pageable;
  /**
   * 总页数
   */
  totalPages: number;
  /**
   * 医院的总数
   */
  totalElements: number;
  last: boolean;
  first: boolean;
  sort: Sort;
  numberOfElements: number;
  size: number;
  number: number;
  empty: boolean;
}

interface Pageable {
  sort: Sort;
  pageNumber: number;
  pageSize: number;
  offset: number;
  paged: boolean;
  unpaged: boolean;
}

interface Sort {
  sorted: boolean;
  unsorted: boolean;
  empty: boolean;
}

/**
 * 定义单个科室的结构
 */
export interface Department {
  depcode: string;
  depname: string;
  children: null | Department[];
}

/**
 * 定义获取科室响应结果的结构
 */
export type ReqGetDepartmentResponse = Department[];

/**
 * 获取科室排班信息参数的结构
 */
export interface ReqGetScheduleParams {
  page: number;
  limit: number;
  hoscode: string;
  depcode: string;
}

/**
 * 单个排班规则的结构
 */
export interface ScheduleItem {
  workDate: string;
  workDateMd?: any;
  dayOfWeek: string;
  docCount: number;
  reservedNumber: number;
  availableNumber: number;
  status?: any;
}

/**
 * 响应科室结果的结构
 */
export interface ReqGetScheduleResponse {
  total: number;
  bookingScheduleList: ScheduleItem[];
  baseMap: BaseMap;
}

/**
 * 医院名称的结构
 */
interface BaseMap {
  hosname: string;
}

/**
 * 获取排班医生的参数结构
 */
export interface ReqGetDoctorParams{
  hoscode: string;
  depcode: string;
  workDate: string;
}

/**
 * 单个排班医生的结构
 */
export interface DoctorItem {
  id: string;
  createTime: string;
  updateTime: string;
  isDeleted: number;
  param: DoctorRelaInfo;
  hoscode: string;
  depcode: string;
  title: string;
  docname: string;
  skill: string;
  workDate: string;
  workTime: number;
  reservedNumber: number;
  availableNumber: number;
  amount: number;
  status: number;
  hosScheduleId: string;
}

interface DoctorRelaInfo {
  dayOfWeek: string;
  depname: string;
  hosname: string;
}

/**
 * 定义一个别名, 定义获取医生响应结果的结构
 */
export type ReqGetDoctorResponse = DoctorItem[];



/**
 * 医院详情响应结果的结构
 */
export interface ReqGetHospitalDetailResponse {
  bookingRule: BookingRule;
  hospital: Hospital;
}

interface Hospital {
  id: string;
  createTime: string;
  updateTime: string;
  isDeleted: number;
  param: Param;
  hoscode: string;
  hosname: string;
  hostype: string;
  provinceCode: string;
  cityCode: string;
  districtCode: string;
  address: string;
  logoData: string;
  intro?: any;
  route: string;
  status: number;
  bookingRule?: any;
}
